﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using stockfund.src;
using stockfund.popform;
using MySQLDriverCS;
using System.Data.Common;
namespace stockfund.popform
{
    public partial class frmTesting : Form
    {
        private MySQLConnection conn;
        public frmTesting()
        {
            this.conn = Tools.getConn();
            InitializeComponent();
            

        }

        private void frmTesting_Load(object sender, EventArgs e)
        {
            string testsql = "select distinct(code),name from okzcggstat";
            MySQLCommand cmd = new MySQLCommand("set names gbk",conn);
            cmd.ExecuteNonQuery();
            cmd = new MySQLCommand(testsql, conn);
            DbDataReader reader =  cmd.ExecuteReader();
            List<string> names = new List<string>();
            Encoding gbk = Encoding.GetEncoding("gbk");
            Encoding gb2312 = Encoding.GetEncoding("gb2312");
            Encoding utf8 = Encoding.UTF8;
            while (reader.Read())
            {
                names.Add(reader.GetString(0) + ":" + reader.GetString(1));
            }
            this.lbx_testCode.DataSource = names; 
        }

        private void btn_getdate_Click(object sender, EventArgs e)
        {

        }
    }
}
